package tas.java;

public class EncDec {

    private final String cryptKey = "aPb4x9q0H4W8rPs7";

    public String encripta(String pass) {
        AES aes = new AES();
        aes.setKey(cryptKey);

        if (pass.length() < 16) {
            for (int i = pass.length(); i < 16; i++) {
                pass += " ";
            }
        }

        pass = aes.Encrypt(pass);
        return pass;
    }

    public String decripta(String pass) {
        AES aes = new AES();
        aes.setKey(cryptKey);
        pass = aes.Decrypt(pass).trim();

        return pass;
    }

    public EncDec() {
    }
}
